package easycloud.ecs.common.repository;

import java.util.List;
import java.util.Set;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import easycloud.ecs.common.domain.Sync;
import easycloud.ecs.common.domain.User;

public interface SyncRepository extends JpaRepository<Sync, Integer> {

	@Query("from Sync s where s.provider.id = :providerId")
	Set<Sync> findByProvider(@Param("providerId") Integer providerId);

	@Query("from Sync s where s.folder.user = :user")
	List<Sync> findByUser(@Param("user") User user);

}
